package com.itplh.modules.shiroini.controller;

import com.alibaba.fastjson.JSON;
import com.itplh.modules.shiroini.service.ShiroService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Description:
 * @Author: tanpeng
 * @Date: 2019-07-11 18:29
 * @Version: V1.0
 */
@RestController
@RequestMapping(value = "/shiroini")
public class UserLoginController {

    @Autowired
    ShiroService shiroService;

    @PostMapping(value = "/login")
    public String userLoginAction(@RequestBody Map<String, String> map) {
        String username = map.get("username");
        String password = map.get("password");
        return JSON.toJSONString(shiroService.userLoginAction(username, password));
    }

}
